package com.example.demo.data;

import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
public class ResultDate<T> {
    private Integer status;
    private Integer code;
    private String msg;
    private List<T> list;
    private T obj;
    private PageInfo<T> pageInfo;

    public ResultDate() {
        //1成功 ；-1 失败
        this.status = 1;
        this.code = 200;
        this.msg = "OK";
        this.list = null;
        this.obj = null;
    }

    public ResultDate(Integer status, Integer code, String msg) {
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public ResultDate(Integer status, Integer code, String msg, List<T> list) {
        this.status = status;
        this.code = code;
        this.msg = msg;
        this.list = list;
    }

    public ResultDate(Integer status, Integer code, String msg, T obj) {
        this.status = status;
        this.code = code;
        this.msg = msg;
        this.obj = obj;
    }
}
